package com.zcf.airobot.vo;

import lombok.AllArgsConstructor;
import lombok.Data;
import org.springframework.ai.chat.messages.Message;

/**
 * @author zcf
 */
@Data

public class MessageVo {
    private String role;
    private String content;
    public MessageVo(Message message) {
        this.role = switch (message.getMessageType()) {
            case USER -> "user";
            case ASSISTANT -> "assistant";
            case SYSTEM -> "system";
            default -> "";
        };
        this.content = message.getText();
    }

}
